//
//  AuthCodeLoginVC.m
//  EducationLive
//
//  Created by Apple on 2017/10/17.
//  Copyright © 2017年 ZhouHao. All rights reserved.
//

#import "AuthCodeLoginVC.h"
#import "EducationLiveGloabl.h"

@interface AuthCodeLoginVC ()

@end

@implementation AuthCodeLoginVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // 加载导航栏item
    [self loadNavItem];
}

#pragma mark - NavigationController Item Title
// 加载导航栏item
- (void)loadNavItem
{
    self.title = @"验证码登录";
}

#pragma mark - Action
// 验证码
- (IBAction)AuthCodeAction:(JKCountDownButton *)sender
{
    sender.enabled = NO;
    //button type要 设置成custom 否则会闪动
    [sender startCountDownWithSecond:60];
    
    [sender countDownChanging:^NSString *(JKCountDownButton *countDownButton,NSUInteger second) {
        NSString *title = [NSString stringWithFormat:@"重新发送(%zds)",second];
        [countDownButton setBackgroundImage:[UIImage imageNamed:@"yanzhengma_button_sele"] forState:UIControlStateNormal];
        [countDownButton setTitleColor:RGB_255(204,204,204) forState:UIControlStateNormal];
        return title;
    }];
    [sender countDownFinished:^NSString *(JKCountDownButton *countDownButton, NSUInteger second) {
        countDownButton.enabled = YES;
        [countDownButton setBackgroundImage:[UIImage imageNamed:@"yanzhengma"] forState:UIControlStateNormal];
        [countDownButton setTitleColor:RGB_255(255,204,51) forState:UIControlStateNormal];
        return @"重新发送";
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
